<%@ page language="java" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
request.setCharacterEncoding("utf-8");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<base href="<%=basePath%>">
	<title>我的账户</title>
	<jsp:include page="includes/meta_and_link.jsp" flush="true" />
</head>

<body>
<!-- 导航栏  -->
	<jsp:include page="includes/header.jsp" flush="true">
		<jsp:param name="header_title" value="营养订餐-账号" />
	</jsp:include>
<!-- 内容  -->
	<center>
	<div class="account-username-panel">
		<h1>${sessionScope.username}</h1>
	</div>

	</center>
	
	<hr>
	<div class="am-g">
		<div class="am-u-sm-10">昵称：${sessionScope.nickname}</div>
		<div class="am-u-sm-2">
			<button id="nickname" onclick="onEditClick(this)" class="no-style-list-button am-icon-edit"></button>
		</div>
	</div>
	<hr>
	<div class="am-g">
		<div class="am-u-sm-10">昵称：${sessionScope.nickname}</div>
		<div class="am-u-sm-2">
			<button class="no-style-list-button am-icon-edit"></button>
		</div>
	</div>
	<hr>
	<div class="am-g">
		<div class="am-u-sm-10">昵称：${sessionScope.nickname}</div>
		<div class="am-u-sm-2">
			<button class="no-style-list-button am-icon-edit"></button>
		</div>
	</div>
	<hr>
	<div class="am-g">
		<div class="am-u-sm-10">昵称：${sessionScope.nickname}</div>
		<div class="am-u-sm-2">
			<button class="no-style-list-button am-icon-edit"></button>
		</div>
	</div>
	<hr>
	<div class="am-g">
		<div class="am-u-sm-10">昵称：${sessionScope.nickname}</div>
		<div class="am-u-sm-2">
			<button class="no-style-list-button am-icon-edit"></button>
		</div>
	</div>
	<hr>
	
	<center>
		<form action="action/user/logout" method="post">
			<button type="submit" class="am-btn am-btn-danger">退出当前账户</button>
		</form>
	</center>

	<div class="am-modal am-modal-prompt" tabindex="-1" id="edit-prompt">
		<div class="am-modal-dialog">
			<div class="am-modal-hd">编辑</div>
			<div class="am-modal-bd">
				<input type="text" class="am-modal-prompt-input">
			</div>
			<div class="am-modal-footer">
				<span class="am-modal-btn" data-am-modal-cancel>取消</span>
				<span class="am-modal-btn" data-am-modal-confirm>提交</span>
			</div>
		</div>
	</div>
	
<!-- 底部栏  -->
	<jsp:include page="includes/footer.jsp" flush="true" />
	
<!-- JavaScript放在这里提高性能 -->
<script type="text/javascript">
	function onEditClick(btn) {
		$('#edit-prompt').modal({
			relatedTarget : this,
			onConfirm : function(e) {
				$.post("action/user/editInfo", {
					"edit-id" : btn.id,
					"edit-value" : e.data
				}, function(data, status) {
					location.reload([true])  
				})
			}
		});
	}
</script>
</body>
</html>